<%@ page contentType="text/html; charset=UTF-8"%>
<%@ include file="/commons/taglibs.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title><s:text name="horseadimn"/></title>
<script type="text/javascript" src="${ctx}/scripts/commons/jquery-1.2.3.pack.js"></script>
<script src="${ctx}/scripts/datepicker/WdatePicker.js"></script>
<script type="text/javascript">
     
     
     //过滤特殊字符
function checkStr(str){
	if(str.value!=""){
	      if (!(/^[^\|"'<>:;：；‘“$%*@,.，。/、！·#￥%……—*（）——+| ]*$/.test(str))){
	      		return false;
	      }
	}
	return true;
}
function deleteDownload(downId) {
	  if(window.confirm('确定要删除吗?')) {
	  		window.location = "${ctx }/download/download!delete.action?downId="+downId;
	  }  
	}
	function showFun(){
	    var s1=window.location;
	    var s2=(s1+"").split("!");
	    var str=s2[0]+"!index.action";
		var item=window.showModalDialog("${ctx}/user/user_showFun.action?funcstr="+ str,window,"scroll:no;dialogHeight=500px;dialogWidth=420px;");
		var names ="";
        var ids ="";
	  		if(item != null){
	    
	          names += item[0][0];
	          ids += item[0][1];
	      	}
      	document.getElementById("funcId").value = ids;
    	document.getElementById("funcname").value = names;
	}
 </script>
</head>
<link href="${ctx}/css/main/base.css" rel="stylesheet" type="text/css"/>
<link href="${ctx}/css/main/main.css" rel="stylesheet" type="text/css"/>
<body class="m_6">
<div id="main">
	<div class="zdsz" id="select1">
		<div class="tab"><a href="${ctx}/download/download!index.action"><h3>添加下载</h3></a><a href="${ctx}/download/download!listDownload.action"><h3 class="sel">下载列表</h3></a></div>
		<div class="zd_gut">
		<ul class="block">
		<li>
		<form action="${ctx }/download/download!downloadSearch.action?" method="post">
		<div class="zc_but2">  
		功能分类：
        <input type="hidden" id="funcId" name="download.funcId" />
    	<input type="input" id="funcname" readonly name="funcnames" onclick="showFun();"/> 
		 文件标题：
          <input name="downHead" type="text" onblur="if(!checkStr(this.value)){$('#ErrorName').empty();$('#ErrorName').append('<font color=\'red\'><s:text name="bg.specialchar"/></font>');this.value='';}else{$('#ErrorName').empty();}"/>
         文件名：
          <input name="downName" type="text"/>
          <input name="button"  type="submit" class="log_f zc_b" value="查询"/></div>
		<div  id="ErrorName"  align="center"></div>
		</form>
    			<table width="90%" border="0" align="center" cellpadding="0" cellspacing="0" class="tab_1 center">
				  <tr>
				    <td class="bg4">功能分类</td>
				    <td class="bg4">文件标题</td>
					<td class="bg4">文件名</td>
					<td class="bg4">文件大小</td>
					<td class="bg4">下载次数</td>
					<td class="bg4">操作</td>
				  </tr>
				  <s:iterator value="flipData.data" status="download" id="down">
				  <tr>
				  	<td>
		                 <s:property value="flipData.data[#download.index][0]"/>
					</td>
					<td>
						<a href="${ctx }/download/download!downloadFile.action?downId=<s:property value="flipData.data[#download.index][5]"/>"><s:property value="flipData.data[#download.index][1]"/></a>
					</td>
					<td>
		                 <s:property value="flipData.data[#download.index][2]"/>
					</td>
					<td>
		                 <s:property value="flipData.data[#download.index][3]"/>
					</td>
					<td>
		                 <s:property value="flipData.data[#download.index][4]"/>
					</td>
					<td>
		                 <a href="${ctx }/download/download!modify.action?downId=<s:property value="flipData.data[#download.index][5]"/>">编辑</a><a href="${ctx }/download/download!downloadFile.action?downId=<s:property value="flipData.data[#download.index][5]"/>">下载</a><span onclick=" deleteDownload('<s:property value="flipData.data[#download.index][5]"/>');" style="cursor: pointer;"> 删除</span>
					</td>
					
					</tr>
				  </s:iterator>
		  		</table> 
              <form action="download!listDownload.action" method="post" name="pageform">
		  			  	 <div class="fy01" align="center">
          	    <input type="hidden" value="<s:property value="flipData.page" />" name="flipData.page" id="page">
				<s:text name="index.pagebar.first"/><s:property value="flipData.total" />
				<s:text name="index.pagebar.second"/>
				<s:property value="flipData.size" />
				<s:text name="index.pagebar.third"/>
				<s:property value="flipData.page" />
				/<s:property value="flipData.totalPageCount" />
				<s:text name="index.pagebar.first"/>
				<s:property value="flipData.totalPageCount" />
				<s:text name="index.pagebar.fouth"/>　　
				 <<
				<a href="javascript:document.getElementById('page').value=1;list();"><s:text name="index.pagebar.fifth"/></a>&nbsp;&nbsp;
				<s:if test="flipData.page >1 ">
					<a href="javascript:document.getElementById('page').value=parseInt(document.getElementById('page').value)-1;list();"><s:text name="index.pagebar.priv"/></a>&nbsp;&nbsp;
                </s:if>
				<s:if test="flipData.page < flipData.totalPageCount">
					<a href="javascript:document.getElementById('page').value=parseInt(document.getElementById('page').value)+1;list();"><s:text name="index.pagebar.next"/></a>&nbsp;&nbsp;
     		    </s:if>
				<a href="javascript:<s:if test="#request.flipData.totalPageCount > 0">document.getElementById('page').value=<s:property value="#request.flipData.totalPageCount"/></s:if>;list();"><s:text name="index.pagebar.last"/></a>
				>>
				</input>	
			</div>
			</form>
						
         </li>
		</ul>
		</div>
	</div>
</div>
</body>
</html>
<script type="text/javascript">
<!--
function issunamelist(){
document.forms[0].submit();
}

function list(){
document.forms[1].submit();
}

function issuelist(){
if( ($("input:checked").size())==0){
  			alert("<s:text name="bg.horse.choose" />");
  			return;
  }
document.forms[1].submit();
}
//--></script>
